﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LD.Host
{
    public partial class FrmFobAoiSearch : BaseFrm
    {
        public FrmFobAoiSearch()
        {
            InitializeComponent();
        }

        private void btn_search_Click(object sender, EventArgs e)
        {
            var dataList = DBHelper.Instance.Sql.Queryable<TB_FobAoi>()
                .Where(p => p.CreateTime >= this.dateTimeS.Value && p.CreateTime <= this.dateTimeE.Value)
                .WhereIF(!string.IsNullOrEmpty(this.txt_partNo.Text), p => p.PartNo == this.txt_partNo.Text)
                .WhereIF(!string.IsNullOrEmpty(this.txt_barcode.Text), p => p.SN == this.txt_barcode.Text)
                .ToList();
            this.dgv_data.DataSource = dataList;
        }
    }
}
